<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>flex布局-弹性换行</title>
  <style>
    .box {
      display: flex;
      /* wrap换行,  */
      flex-wrap: wrap;
      justify-content: space-between;

      /* nowrap不换行 */
      /* flex-wrap: nowrap; */

      height: 300px;
      border: 1px solid #000;
    }
    .box div {
      width: 200px;
      height: 100px;
      background-color: pink;
    }
  </style>
</head>
<body>
  <!-- 
    弹性盒子可以自动挤压或拉伸,默认情况下,所有弹性盒子都在一行显示
    属性名: flex-wrap
   -->
   <div class="box">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7</div>
    <div>8</div>
    <div>9</div>
    <div>10</div>
    <div>11</div>
    <div>12</div>
   </div>
</body>
</html>